﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlBaoCaoNgayTonKho.ascx.cs" Inherits="UserControl_ControlBaoCaoNgayTonKho" %>

<%@ Register assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>

<%@ Register assembly="DevExpress.Web.ASPxPivotGrid.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPivotGrid" tagprefix="dxwpg" %>
<%@ Register assembly="DevExpress.Web.ASPxPivotGrid.v9.2.Export, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.XtraPivotGrid.Web" tagprefix="dxpgw" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dxpc" %>


<script type="text/javascript">
    function pageLoad() {

        $("#<%= imgBtnAdd.ClientID %>").click(function () {

            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });

        });
        $("#<%= imgBtnSave.ClientID %>").click(function () {
            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });
            setTimeout($.unblockUI, 5000);
        });
        
        $("#<%= imgBtnClearFilter.ClientID %>").click(function () {

            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });

        });

        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        function EndRequestHandler(sender, args) {
            $.unblockUI();
        }

    }

</script>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:PostBackTrigger ControlID="imgBtnSave" />

</Triggers>
    <ContentTemplate>
    
                <div class="direct_container_right_titletop direct_colleft">
                    Báo cáo ngày tồn kho
                </div>
                
                <!-- Button chuc nang-->
                <div class="direct_menu_report_page direct_colleft">
                
                    Chọn tháng
                  
                    <asp:DropDownList ID="DropMonthy" runat="server" >
                    </asp:DropDownList>
                   
                    <asp:ImageButton ID="imgBtnAdd" CausesValidation="false" onclick="imgBtnAdd_Click" ToolTip="Lấy dữ liệu"  ImageUrl="~/Images/Document.png" Width="32px" Height="32px" runat="server" />
                    <asp:ImageButton ID="imgBtnSave" onclick="imgBtnSave_Click" CausesValidation="false" ToolTip="Xuất ra file excel dạng thường" ImageUrl="~/Images/download.png" Width="32px" Height="32px" runat="server" />
                   
                     <asp:ImageButton ID="imgBtnClearFilter" runat="server" CausesValidation="false" 
                        Height="32px" ImageUrl="~/Images/Refresh.png" onclick="imgBtnClearFilter_Click" 
                        ToolTip="Reset lại dữ liệu" Width="32px" />
                </div>
                <!-- End Button chuc nang-->
                <div class="clear"></div>
                 <hr />

                
                   <table>
                   
                    <tr>
                    <td>
                      <dxpgw:ASPxPivotGridExporter ID="ASPxPivotGridExporter1" ASPxPivotGridID="ASPxPivotGrid1" runat="server" Width="100%">
        </dxpgw:ASPxPivotGridExporter>
        <dxwpg:ASPxPivotGrid ID="ASPxPivotGrid1" runat="server">
                 <Fields>
                

                <dxwpg:PivotGridField ID="fieldGAM" Caption="Trung tâm phân phối" FieldName="Sitename" 
                         Area="FilterArea">
                </dxwpg:PivotGridField>
                <dxwpg:PivotGridField ID="PivotGridField1" Caption="Kho" FieldName="Location" 
                         Area="RowArea" AreaIndex="0">
                </dxwpg:PivotGridField>
                <dxwpg:PivotGridField ID="PivotGridField2" AllowedAreas="RowArea" FieldName="itemkey" Caption="Tên hàng theo NPP" Area="RowArea" 
                          AreaIndex="1">
                </dxwpg:PivotGridField>

              
                
                <dxwpg:PivotGridField ID="fAvgSales" Area="DataArea" AllowedAreas="DataArea"  AreaIndex="0" 
                         Caption="Số lượng TB 03 tháng trước"  CellFormat-FormatType="Numeric" 
                         FieldName="SaleQTY">
                </dxwpg:PivotGridField>
                <dxwpg:PivotGridField ID="fInvQty" Area="DataArea" CellFormat-FormatType="Numeric" AllowedAreas="DataArea"  AreaIndex="1" 
                         Caption="Tồn cuối hiện tại"
                          FieldName="TD">
                </dxwpg:PivotGridField>
             
                     <dxwpg:PivotGridField ID="fInvMonth" CellFormat-FormatType="Numeric" AllowedAreas="DataArea" Caption="Ngày dự báo tồn kho"  Area="DataArea" 
                         AreaIndex="2" FieldName="TB">
                     </dxwpg:PivotGridField>
                
                        
                </Fields>
                 <OptionsView ShowColumnHeaders="False" ShowDataHeaders="False" />
                <OptionsPager Visible="False">
               </OptionsPager>
        </dxwpg:ASPxPivotGrid>
                    </td>
                    </tr>
                 </table>
                              
            <dxpc:ASPxPopupControl ID="MessageBox" PopupHorizontalAlign="WindowCenter"  PopupVerticalAlign="WindowCenter" Font-Bold="true" HeaderText="DRM-S" runat="server" Height="91px" 
        Width="601px">
        <ContentCollection>
<dxpc:PopupControlContentControl ID="PopupControlContentControl1" runat="server" SupportsDisabledAttribute="True"></dxpc:PopupControlContentControl>
</ContentCollection>
    </dxpc:ASPxPopupControl>  
    </ContentTemplate>
</asp:UpdatePanel>